package com.hymjweb.demo.framework.util;

import org.springframework.context.ApplicationContext;

/**
 * @BelongsProject: demo1
 * @BelongsPackage: com.hymjweb.demo.framework.util
 * @Author: luoge
 * @CreateTime: 2019-10-15 16:35
 * @Description: Spring上下文化对象工具
 */
public class SpringContextUtil {

    private static ApplicationContext applicationContext;

    public static void setApplicationContext(ApplicationContext context) {
        applicationContext = context;
    }
    public static ApplicationContext getApplicationContext() {
        return  applicationContext;
    }

    public static Object getBean(String beanId) {
        return applicationContext.getBean(beanId);
    }

}
